<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Source - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
	<h1 translate="no">Source</h1>
		<section>
			<header>
				<div class="class-description"><p>Represents the data source of a texture.</p>
<p>The main purpose of this class is to decouple the data definition from the texture
definition so the same data can be used with multiple texture instances.</p></div>
			</header>
			<article>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="Source" translate="no">new <a href="#Source">Source</a><span class="signature">( data : <span class="param-type"><a href="global.html#any">any</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new video texture.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>data</strong>
									</td>
									<td class="description last">
										<p>The data definition of a texture.</p>
										<p>Default is <code>null</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="data" translate="no">.<a href="#data">data</a><span class="type-signature"> : <a href="global.html#any">any</a></span> </h3>
					<div class="description">
						<p>The data definition of a texture.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="dataReady" translate="no">.<a href="#dataReady">dataReady</a><span class="type-signature"> : boolean</span> </h3>
					<div class="description">
						<p>This property is only relevant when <a href="Source.html#needsUpdate">Source#needsUpdate</a> is set to <code>true</code> and
provides more control on how texture data should be processed. When <code>dataReady</code> is set
to <code>false</code>, the engine performs the memory allocation (if necessary) but does not transfer
the data into the GPU memory.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="id" translate="no">.<a href="#id">id</a><span class="type-signature"> : number</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>The ID of the source.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="isSource" translate="no">.<a href="#isSource">isSource</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This flag can be used for type testing.</p>
						<p>Default is <code>true</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="needsUpdate" translate="no">.<a href="#needsUpdate">needsUpdate</a><span class="type-signature"> : boolean</span> </h3>
					<div class="description">
						<p>When the property is set to <code>true</code>, the engine allocates the memory
for the texture (if necessary) and triggers the actual texture upload
to the GPU next time the source is used.</p>
						<p>Default is <code>false</code>.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="uuid" translate="no">.<a href="#uuid">uuid</a><span class="type-signature"> : string</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>The UUID of the source.</p>
					</div>
				</div>
				<div class="member">
					<h3 class="name" id="version" translate="no">.<a href="#version">version</a><span class="type-signature"> : number</span> <span class="type-signature">(readonly) </span></h3>
					<div class="description">
						<p>This starts at <code>0</code> and counts how many times <a href="Source.html#needsUpdate">Source#needsUpdate</a> is set to <code>true</code>.</p>
						<p>Default is <code>0</code>.</p>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="getSize" translate="no">.<a href="#getSize">getSize</a><span class="signature">( target : <span class="param-type"><a href="Vector2.html">Vector2</a> | <a href="Vector3.html">Vector3</a></span> )</span><span class="type-signature"> : <a href="Vector2.html">Vector2</a> | <a href="Vector3.html">Vector3</a></span> </h3>
					<div class="method">
						<div class="description">
							<p>Returns the dimensions of the source into the given target vector.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>target</strong>
									</td>
									<td class="description last">
										<p>The target object the result is written into.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The dimensions of the source.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="toJSON" translate="no">.<a href="#toJSON">toJSON</a><span class="signature">( meta : <span class="param-type">Object | string</span> )</span><span class="type-signature"> : Object</span> </h3>
					<div class="method">
						<div class="description">
							<p>Serializes the source into JSON.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>meta</strong>
									</td>
									<td class="description last">
										<p>An optional value holding meta information about the serialization.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-see">See:</dt>
							<dd class="tag-see">
								<ul>
									<li><a href="ObjectLoader.html#parse">ObjectLoader#parse</a></li>
								</ul>
							</dd>
						</dl>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A JSON object representing the serialized source.</dt>
						</dl>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/src/textures/Source.js" translate="no" target="_blank" rel="noopener">src/textures/Source.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>